<?php
/**
 * Abstract class which connects to a database server.
 */
abstract class OORDBConnection implements IteratorAggregate
{
	/**
	 * Get the name of the server.
	 * @return string Server name
	 */
	abstract public function getServer();
	
	/**
	 * Get the user connected to the server.
	 * @return string User name
	 */
	abstract public function getUser();
	
	/**
	 * Get the databases available.
	 * @return Iterator Iterator across a list of OORDBDatabases
	 */
	abstract public function getDatabases();
		
	/**
	 * Create a new generic query object.
	 */
	abstract public function newQuery();
	
	/**
	 * Create a new insert query object.
	 */
	abstract public function newInsertQuery();
	
	/**
	 * Create a new select query object.
	 */
	abstract public function newSelectQuery();
	
	/**
	 * Get the databases available.
	 * @return Iterator Iterator across a list of OORDBDatabases
	 */
	public function getIterator()
	{
		return $this->getDatabases();
	}
}
?>